<?php

class Application_Controller_Helper_Acl extends Zend_Controller_Action_Helper_Abstract
{
    /**
     * @param mixed $resource
     * @param mixed $privilege
     * @return void
     * @throws Application_Http_Exception403
     */
    public function assertAllowed($resource, $privilege)
    {
        if (!$this->isAllowed($resource, $privilege)) {
            throw new Application_Http_Exception403();
        }
    }

    /**
     * @param mixed $resource
     * @param mixed $privilege
     */
    public function isAllowed($resource, $privilege)
    {
        return Application_Acl::getInstance()
                   ->isAllowed($resource, $privilege);
    }
}